<?xml version='1.0' encoding='UTF-8' ?>
<!--
    Document   : centro
    Created on : 14/06/2011, 20:59:58
    Author     : Edmilson
-->

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:icecore="http://www.icefaces.org/icefaces/core"

      xmlns:ice="http://www.icesoft.com/icefaces/component"
      >





    <!-- <h:form>
         <icecore:singleSubmit/>
         <h:panelGroup style=" ">


             <ice:panelCollapsible  toggleOnClick="#{!acao.imediato}" actionListener="#{acao.trocaPainel1}" styleClass="iceForm" id="linkPanel"  expanded="#{acao.flagPanelFormulario}" style="">
                 <f:facet name="header">
                     <ice:panelGroup style="color: black; width: 100%">
                         <ice:outputText  id="linkHeader" value="Formulario:"/>
                         <ui:insert name="titulo"/>
                     </ice:panelGroup>
                 </f:facet>
                 <h:panelGroup>
                 </h:panelGroup>

                 <h:panelGrid   style="text-align: center; border:solid 0px blue;height:365px ; z-index: 1" width="100%">
                     
                     <h:panelGrid  style="margin: 0; text-align: center;  border:solid 0px red ; width:100%; height: 100%">
                         <h:panelGrid style="text-align: left; margin: 0 auto ; font-size: 12px" id="panelCampos">
                             <ui:insert name="formulario" /> 

                         </h:panelGrid>

                     </h:panelGrid>




                 </h:panelGrid>


                 <h:panelGrid columns="4" style="border:solid 0px red; width:120px;  margin-left:34px; margin-top:-26px">

                     <h:commandButton style="margin-left:0px "  value="INSERIR" image="resources/btInserir.png" />
                     <h:commandButton style="margin-left:43px "  value="EXCLUIR" image="resources/btExcluir.png"  />
                     <h:commandButton style="margin-left:43px "  value="SALVAR" image="resources/btSalvar.png" />
                     <h:commandButton style="margin-left:42px; " value="CANCELAR"  image="resources/btCancelar.png"  />

                 </h:panelGrid>

             </ice:panelCollapsible>
             
             <ice:panelCollapsible  toggleOnClick="#{!acao.imediato}" actionListener="#{acao.trocaPainel}" styleClass="iceForm"   id="linkPanel2"  expanded="#{acao.flagPanelConsulta}" >
                 <f:facet name="header">
                     <ice:panelGroup style="color: black; width: 100%">
                         <ice:outputText  id="linkHeader2" value="Consulta:"/>
                         <ui:insert name="titulo"/>
                     </ice:panelGroup>
                 </f:facet>

                 <ice:panelGrid style=" font-size: 12px; border:solid 0px red; " columns="7">
                     <ice:outputText  style="font-weight: bold" value="Coluna:"/>

                     <ice:selectOneMenu id="coluna" style="width:130px">
                         <f:selectItems />
                     </ice:selectOneMenu>
                     <ice:selectOneMenu  id="operador" style="width:130px" >
                         <f:selectItems />
                     </ice:selectOneMenu>
                     <ice:inputText  id="itTexto" style="width:250px"/>
                     <ice:commandButton value="Consultar" image="/resources/btConsultar.png" title="Consulta Simples" />
                     <ice:panelGroup style="width: 270px; text-align: center">

                         <ice:message  errorClass="errorMessage" showDetail="true" fatalClass="fatalMessage" style="border: solid 1px red; color: red;" for="itTexto" id="messageitTexto" infoClass="infoMessage" showSummary="true" warnClass="warnMessage"/>
                         <ice:messages errorClass="errorMessage" fatalClass="fatalMessage" globalOnly="true" id="messages1" infoClass="infoMessage"
                                       showDetail="true" showSummary="true" style="color: red; border:solid 1px red" warnClass="warnMessage"/>
                     </ice:panelGroup>
                     <ice:commandButton   image="/resources/btRecarregar.png" immediate="true" title="Recarregar a Tabela com todos os Dados" />


                 </ice:panelGrid>

                 <ice:panelGrid   style="border:solid 0px red; height:330px" >
                     <ice:panelGroup  style="text-align: center; width: 975px; overflow: auto; border: solid 1px red; height: 300px" >

                         <ice:dataTable resizable="true"  cellpadding="0" headerClass="icelist-header"  
                                        rowClasses="icelist-row-even,icelist-row-odd" clientOnly="true" style="margin-top:-3px; width:100%;"
                                         >
                             <ice:column rendered="false">
                                 <ice:rowSelector   clickedRow="-1" enhancedMultiple="false"
                                                   multiple="false" preStyleOnSelection="true"   />
                             </ice:column>
                             <ice:columns   var="headings">
                                 <ice:outputText  value="teste"/>
                                 <f:facet name="header">
                                     <ice:outputText value="headings"/>
                                 </f:facet>

                             </ice:columns>
                         </ice:dataTable>

                         <div style="height: 25px; margin: 0 auto; width:110px; border: solid 0px red  ">
                             <ice:panelGrid columns="4">
                                 <ice:commandButton  image="resources/btPrimeira.png"   title="Primeira Página" />
                                 <ice:commandButton  image="resources/btAnt.png" style="margin-left: 10px" title="Página Anterior" />
                                 <ice:commandButton  image="resources/btProx.png"  style="margin-left: 10px"  title="Próxima Página"  />
                                 <ice:commandButton  image="resources/btUltimo.png" title="Última Página" style="margin-left: 10px"  />

                             </ice:panelGrid>
                         </div>

                     </ice:panelGroup>
                     <ice:panelGrid style=" margin-left: 0px; text-align: left" columns="2">
                         <ice:commandButton title="Alterar Registro Selecionado na Tabela" style="margin-left:20px;" image="resources/btAlterar.png" />
                         <ice:commandButton style="margin-left:20px; " title="Abrir Consulta Detalhada" rendered="false"/>
                     </ice:panelGrid>
                 </ice:panelGrid>


             </ice:panelCollapsible>

         </h:panelGroup> -->

    <ice:panelPopup  autoCenter="false" modal="true" autoPosition="350,250" draggable="false" id="panelPopupExcluirRegistro"  rendered="#{botoes.controllerPagina.renderizaConfirmaExclusao}"
                     style="height:auto;  width: 300px;  z-index:50000000">
        <f:facet name="header">
            <ice:panelGrid id="panelGridheaderExcluir" style="display:block;width:220px;height:20px;">
                <ice:outputText id="outputTextConfirmaExclusao" value="Confirmar Exclusão"/>

            </ice:panelGrid>
        </f:facet>
        <f:facet name="body">
            <ice:panelGrid id="panelGridsasd" style="display: block; border: 2px solid rgb(204, 204, 204); height: 100%; width: 100%;">
                <ice:outputText id="outputTextCerteza" style="font-weight: bolder" value="Deseja realmente excluir o registro selecionado?"/>
                <ice:panelGrid  id="panelLayoutBotoesExcluir" columns="2" style="height: 100%; text-align: center; width: 100%  ">
                    <ice:commandButton actionListener="#{botoes.controllerPagina.confirmarExclusao}" id="btnConfirmarExclusao" image="/resources/botSim.png" immediate="true"
                                       />                      
                    <ice:commandButton actionListener="#{botoes.controllerPagina.cancelarExclusao}"  image="/resources/botNao.png" immediate="true"
                                       />
                </ice:panelGrid>
                <ice:messages errorClass="errorMessage" fatalClass="fatalMessage" globalOnly="true" id="messagesExcluir" infoClass="infoMessage"
                              layout="table" showDetail="true" showSummary="true" style="color: red; height: 96px; width: 96px" warnClass="warnMessage"/>
            </ice:panelGrid>
        </f:facet>
    </ice:panelPopup>



    <ice:panelGroup style=" width:1000px;   height:100%; border:solid 0px red ">
        <ice:panelCollapsible  toggleOnClick="#{!botoes.controllerPagina.imediato}" actionListener="#{botoes.controllerPagina.trocaPainel1}" styleClass="iceForm" id="linkPanel"  expanded="#{botoes.controllerPagina.flagPanelFormulario}" style="">
            <f:facet name="header">
                <ice:panelGroup style="color: black; width: 100%">
                    <ice:outputText  id="linkHeader" value="Formulário:"/>
                    <ui:insert name="titulo"/>
                </ice:panelGroup>
            </f:facet>
            <ice:panelGroup  rendered="#{botoes.controllerPagina.formularioDesabilitado}" style="border:solid 0px red; position: absolute;height: 400px; width:1000px ; margin-left:-8px; margin-top:-3px;background-repeat:no-repeat; background-image: url(resources/FormBloqueado.png)">
            </ice:panelGroup>
            <ice:panelGrid   style="text-align: center; border:solid 0px blue;height:430px ; z-index: 1" width="100%">
                <!-- FORMULARIO -->
                <ice:panelGrid  style="margin: 0; text-align: center;  border:solid 0px red ;  width:100%;">
                    <ice:panelGrid style="text-align: left; margin: 0 auto ; font-size: 13px; margin-top:-15px; position: relative; " id="panelCampos">
                        <ice:panelGroup style="height: 370px; width:900px; overflow: auto;">
                            <ice:panelGrid style="text-align:center; border: solid 2px red" rendered="#{(!empty facesContext.messageList)}" >                    
                                <ui:insert name="mensagens"/>
                                <ice:messages globalOnly="true" showDetail="false" showSummary="true" style="font-size: small; text-align: center; color: red"/>
                            </ice:panelGrid>
                                <ui:insert name="formulario"/>                                 
                        </ice:panelGroup>
                    </ice:panelGrid>

                </ice:panelGrid>

            </ice:panelGrid>
            <ice:panelGrid columns="4" style="border:solid 0px red;width:120px;  margin-left:10px; margin-top:-26px">
                <ice:commandButton title="Inserir Registro" style="margin-left:0px " rendered="#{botoes.controllerPagina.formularioDesabilitado}" image="resources/btInserir.png"  actionListener="#{botoes.controllerPagina.inserir}"/>
                <ice:commandButton title="Alterar Registro"  style="margin-left:20px;" rendered="#{botoes.controllerPagina.formularioDesabilitado}" image="resources/btAlterar.png" actionListener="#{botoes.controllerPagina.editar}"/>
                <ice:commandButton title="Salvar Alterações" style="margin-left:0px " rendered="#{!botoes.controllerPagina.formularioDesabilitado}" image="resources/btSalvar.png"  actionListener="#{botoes.controllerPagina.salvarRegistro}"/>
                <ice:commandButton title="Cancelar Alterações" style="margin-left:20px; " rendered="#{!botoes.controllerPagina.formularioDesabilitado}" image="resources/btCancelar.png" immediate="true" actionListener="#{botoes.controllerPagina.cancelar}"/>
                <ice:commandButton  title="Excluir Registro" rendered="#{botoes.controllerPagina.formularioDesabilitado}" style="margin-left:20px; " image="resources/btExcluir.png"  actionListener="#{botoes.controllerPagina.abrirConfirmacaoDeExclusao}"/>
            </ice:panelGrid>

        </ice:panelCollapsible>
        <!--CONSULTA-->
        <ice:panelCollapsible toggleOnClick="#{!botoes.controllerPagina.imediato}" actionListener="#{botoes.controllerPagina.trocaPainel}" styleClass="iceConsultabl" style="border:solid 0px red"  id="formPanel" expanded="#{botoes.controllerPagina.flagPanelConsulta}">
            <f:facet   name="header">
                <ice:panelGroup style="color: black">
                    <ice:outputText  id="formHeader" value="Consulta:"/>
                    <ui:insert name="titulo"/>
                </ice:panelGroup>
            </f:facet>
            <ice:panelGrid style=" border:solid 0px red; " columns="7">
                <ice:outputText  style="font-weight: bold" value="Coluna:"/>
                <ice:selectOneMenu  id="coluna" style="width:130px" value="#{botoes.controllerPagina.somCampo}">
                    <f:selectItems value="#{botoes.controllerPagina.colunas}"/>
                </ice:selectOneMenu>
                <ice:selectOneMenu  id="operador" value="#{botoes.controllerPagina.somOperador}" valueChangeListener="#{botoes.controllerPagina.processarOperador}">
                    <f:selectItems value="#{botoes.controllerPagina.operadores}"/>
                </ice:selectOneMenu>
                <ice:inputText value="#{botoes.controllerPagina.itTexto}" actionListener="#{botoes.controllerPagina.consultar}" converter="#{botoes.controllerPagina.conversor}" id="itTexto" style="width:250px"/>
                <ice:commandButton value="Consultar" actionListener="#{botoes.controllerPagina.consultar}" image="/resources/btConsultar.png" title="Consulta Simples" />
                <ice:panelGroup style="width: 250px; text-align: center">
                    <ice:message  errorClass="errorMessage" showDetail="true" fatalClass="fatalMessage" style="border: solid 1px red; color: red;" for="itTexto" id="messageitTexto" infoClass="infoMessage" showSummary="true" warnClass="warnMessage"/>
                    <ice:messages errorClass="errorMessage" fatalClass="fatalMessage" globalOnly="true" id="messages1" infoClass="infoMessage"
                                  showDetail="true" showSummary="true" style="color: red; border:solid 1px red" warnClass="warnMessage"/>
                </ice:panelGroup>
                <ice:commandButton  actionListener="#{botoes.controllerPagina.recarregarTabela}" image="/resources/btRecarregar.png" immediate="true" title="Recarregar a Tabela com todos os Dados" />


            </ice:panelGrid>

            <ice:panelGrid   style="border:solid 0px red; height:400px" >
                <ice:panelGroup  style="text-align: center; width: 965px; overflow: auto; border: solid 0px red; height: 400px" >
                    <ice:dataTable resizable="true"   cellpadding="0" headerClass="icelist-header"  
                                   rowClasses="icelist-row-even,icelist-row-odd" clientOnly="true" style="margin-top:0px; width:100%;"
                                   value="#{botoes.controllerPagina.rowModel}"  >

                        <ice:columns  value="#{botoes.controllerPagina.columnsModel}" var="headings">

                            <ice:outputText  value="#{botoes.controllerPagina.cellValue}"/>
                            <f:facet name="header">
                                <ice:outputText value="#{headings}"/>
                            </f:facet>
                        </ice:columns>
                        <ice:column rendered="true" style="width:30px">
                            <ice:commandButton image="resources/btVisualizar.png" actionListener="#{botoes.controllerPagina.botaoAlterarTabela}"/>
                            <f:facet name="header">
                                <ice:outputText value="Visualizar"/>
                            </f:facet>
                        </ice:column>
                    </ice:dataTable>

                    <div style="height: 25px; margin: 0 auto; width:110px; border: solid 0px red  ">
                        <ice:panelGrid columns="4">
                            <ice:commandButton  image="resources/btPrimeira.png" rendered="#{botoes.controllerPagina.paginaAtual != 0}"  title="Primeira Página" action="#{botoes.controllerPagina.primeiraPagina}"/>
                            <ice:commandButton  image="resources/btAnt.png" rendered="#{botoes.controllerPagina.paginaAtual != 0}" style="margin-left: 10px" title="Página Anterior" action="#{botoes.controllerPagina.anterior}"/>
                            <ice:commandButton  image="resources/btProx.png" rendered="#{botoes.controllerPagina.total &gt; botoes.controllerPagina.proximaPagina}" style="margin-left: 10px"  title="Próxima Página"  action="#{botoes.controllerPagina.proxima}"/>
                            <ice:commandButton  image="resources/btUltimo.png" title="Última Página" style="margin-left: 10px" rendered="#{botoes.controllerPagina.total &gt; botoes.controllerPagina.proximaPagina}"  action="#{botoes.controllerPagina.ultimaPagina}"/>
                        </ice:panelGrid>
                    </div>

                </ice:panelGroup>
                <ice:panelGroup rendered="false" style=" text-align: left" >
                    <ice:commandButton title="Alterar Registro Selecionado na Tabela"  image="resources/btAlterar.png" actionListener="#{botoes.controllerPagina.editar}"/>
                    <ice:commandButton rendered="false" style="margin-left:20px; " image="resources/botConsultaDetalhada.png" title="Abrir Consulta Detalhada" actionListener="#{consultaComplexa.abrirConsultaComplexa}"/>
                    
                </ice:panelGroup>
            </ice:panelGrid>
        </ice:panelCollapsible>
    </ice:panelGroup>


</html>